-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cfg): graph starts from offset 0x01
instead of 0x00
, prune redundant nodes
#559
Conversation
thank you for contributing! i will fix the tests soon. |
As mentioned in #499, there are duplicate nodes in the graph, which leads to incorrect edges. This issue has been fixed by using a mapping to record whether a node has been used: if the node has been used, recursion is not performed.
And the result of the test is:
|
0ff03fb
to
e8db827
Compare
hi @Jon-Becker , I think the change is ready. Thanks for review. |
i will review tonight 🫡 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! just one nit comment. I'll fix the other CFG tests tonight and we can get this merged!
thank you for contributing 
0x01
instead of 0x00
, prune redundant nodes
tests passing locally, env rpc issues here so they wont on these runners. merging anyway :) |
Motivation
Fix this issue: #499
Solution
Subtract 1 from the index, which is
operation.last_instruction.instruction
, thereby shifting the overall offset to start from 0x00 (currently starting from 0x01).I believe this approach is appropriate. Because the downstream program does not seem to use this offset, and this offset only serves as the destination for opcodes such as
JumpI
and related opcodes.